package com.neusoft.ysu.npms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neusoft.ysu.npms.mapper.*;
import com.neusoft.ysu.npms.pojo.Area;
import com.neusoft.ysu.npms.pojo.Department;
import com.neusoft.ysu.npms.pojo.Measure;
import com.neusoft.ysu.npms.pojo.Result;
import com.neusoft.ysu.npms.service.IAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IAreaService {
    @Autowired
    AreaMapper areaMapper;
    @Autowired
    CityMapper cityMapper;
    @Autowired
    TownMapper townMapper;
    @Autowired
    CountyMapper countyMapper;
    @Autowired
    VillageMapper villageMapper;

    @Override
    public Result add(Area type) {
        return new Result<>(0, "", areaMapper.add(type));
    }

    @Override
    public Result deleteMeasure(Area area){
        return new Result<>(0,"",areaMapper.deleteMeasure(area));
    }

    @Override
    public Result updateMeasure(Area area){
        return new Result<>(0,"",areaMapper.updateMeasure(area));
    }

    @Override
    public Result selectAll(){
        return new Result<>(0,"",areaMapper.selectAll());
    }
    @Override
    public Result findById(Area area){
        return new Result<>(0,"",areaMapper.findById(area));
    }
    @Override
    public Result getTownlist(){
        return new Result<>(0,"",townMapper.getTownlist());
    }
    @Override
    public Result getCountylist(){
        return new Result<>(0,"",countyMapper.getCountylist());
    }
    @Override
    public Result getVillagelist(){
        return new Result<>(0,"",villageMapper.getVillagelist());
    }
    @Override
    public Result getCitylist(){
        return new Result<>(0,"",cityMapper.getCitylist());
    }
}
